﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimTank
{

    public class Cooldown
    {
        public bool active;
        public int dur_remain, cool_remain;
        public Cooldown() { duration = 0; cooldown = 0; dur_remain = 0; cool_remain = 0; }
        public Cooldown(int dur, int cool)
        {
            duration = dur; cooldown = cool;
            dur_remain = -1; cool_remain = -1;
        }

        public void Activate()
        {
            dur_remain = duration; cool_remain = cooldown; active = true;
        }

        public static Cooldown operator -(Cooldown c, int time)
        {
            c.dur_remain -= time; c.cool_remain -= time;
            return c;
        }

        public static Cooldown operator --(Cooldown c)
        {
            c.dur_remain--; c.cool_remain--;
            return c;
        }

        private int duration, cooldown;
    }
}
